﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using WindowsApplication1;

using DevExpress.XtraBars;
using DevExpress.XtraTab;
using DevExpress.XtraTab.ViewInfo;
namespace QuanLyKho.GUI
{
    public partial class frmMainForm : DevExpress.XtraEditors.XtraForm
    {
        public frmMainForm()
        {
            InitializeComponent();
        }

        private void XtraForm1_Load(object sender, EventArgs e)
        {

        }



        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            XtraTabPage xt = new XtraTabPage();
            xt.Text = "Nhập Kho";

            uNhapKho u = new uNhapKho();
            xt.Controls.Add(u);

          //  u.Show();
            contentTab.TabPages.Add(xt);
            contentTab.SelectedTabPage = xt;
        }

        private void btThemHangHoa_ItemClick(object sender, ItemClickEventArgs e)
        {
            XtraTabPage xt = new XtraTabPage();
            xt.Text = "Thêm Hàng Hóa";

            uNhapHangHoa u= new uNhapHangHoa();
            xt.Controls.Add(u);

            u.Show();
            contentTab.TabPages.Add(xt);
            contentTab.SelectedTabPage = xt;
        }

        private void contentTab_CloseButtonClick(object sender, EventArgs e)
        {
            ClosePageButtonEventArgs c = (ClosePageButtonEventArgs)e;
          //  MessageBox.Show(e.ToString());
           /// e.
           contentTab.TabPages.Remove((XtraTabPage)c.Page);
        }

        private void btXuatKho_ItemClick(object sender, ItemClickEventArgs e)
        {
            XtraTabPage xt = new XtraTabPage();
            xt.Text = "Xuất Kho";

            uXuatKho u = new uXuatKho();
            xt.Controls.Add(u);

            u.Show();
            contentTab.TabPages.Add(xt);
            contentTab.SelectedTabPage = xt;
        }

        private void btTonKho_ItemClick(object sender, ItemClickEventArgs e)
        {
            XtraTabPage xt = new XtraTabPage();
            xt.Text = "Tồn Kho";

            uTonKho u = new uTonKho();
            xt.Controls.Add(u);

            //  u.Show();
            contentTab.TabPages.Add(xt);
            contentTab.SelectedTabPage = xt;
        }
    }
}